{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Comparison between observed density profiles (SUMup) and modeled density profiles (SNOWPACK and IMAU FDM)\n",
    "### In the past I have computed retrieved density information (SUMup and SNOWPACK) in `Average_Density_Bins.ipynb` and plotted this information in `Density_Bias_Profile.ipynb`. In this notebook I will combine my past work to retrieve information and plot all in one place. \n",
    "### To do:\n",
    "1. Turn of exclusion of density profile 10\n",
    "### First import the necessary packages"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import pickle\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import xarray as xr\n",
    "import cartopy.crs as ccrs\n",
    "import pandas as pd\n",
    "import cartopy.crs as ccrs\n",
    "from pyproj import Geod\n",
    "from Load_and_Process_Datasets import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Load in Lat/Lon/Elevation of all locations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x2b6aa7d16048>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<Figure size 432x288 with 0 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAR0AAAEeCAYAAAC3/sHVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nOydZ1hUV9eGnxmKNAVpKgICKqFosCBiQxGDGAtKVOzB/tpbLEQ0sX6xQ4yJoqLYYn0VBRUBGyKIDVBBQZBeJPQ+7Xw/eCEizDA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7PpBXjujgXYjH4woEAhoaGtLNzY3Oz8+VSqVUKBRUVFSkzs5OBYNBDQ4OyuFw6O7u7nkXbWBg4ItR+hbZbFYej0e1tbXq6OhQOByWy+XS+Pj4mznr9L2IDt6NRCKhWCwml8ul6upqeTweOZ1OXV1dKRqNan5+Xul0WsFgUG63W6FQ6Kf8vSCfz2t3d1c7Ozvy+/3q6ur6CVvzehEd4C8ODg60urqqzc1N+f1+TU9P/98jvTlEB4BRX4sO1+kAMIroADCK6AAwiugAMIroADCK6AAwiugAMIroADCK6AAwiugAMIroADCK6AAwiugAMIroADCK6AAwiugAMIroADCK6AAwiugAMIroADCK6AAwiugAMIroADCK6AAwiugAMIroADCK6AAwiugAMIroADCK6AAwqvhfln+y2Wy/GZkEwFvz6Usv2izLMj0IgHeM3SsARhEdAEYRHQBGER0ARhEdAEb9Ds9bWa6HQ9FxAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 360x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Load data\n",
    "lat_lon_elevation_path = \"/pl/active/nasa_smb/Data/Density_Profile_Lat_Lon_Elevation.txt\"\n",
    "lat, lon, elevation = np.loadtxt(lat_lon_elevation_path, unpack=True)\n",
    "\n",
    "# Plot Data\n",
    "plt.figure(1)\n",
    "fig1 = plt.figure(figsize=(5, 5))\n",
    "ax = plt.axes(projection=ccrs.SouthPolarStereo())\n",
    "ax.coastlines(resolution='110m')\n",
    "ax.set_extent([-180, 180, -90, -65], ccrs.PlateCarree())\n",
    "plt.scatter(lon, lat, linewidth=2, marker='o', transform=ccrs.Geodetic())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Retrieve SUMup inforamtion"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Retrieve sumup data as xarray dataset\n",
    "sumup_path = \"/pl/active/nasa_smb/Data/SUMup_datasets_july2018_density.nc\"\n",
    "sumup = xr.open_dataset(sumup_path)\n",
    "\n",
    "# Store sumup (su) xarray dataset as numpy arrays\n",
    "su_lat = sumup['Latitude'].values\n",
    "su_lon = sumup['Longitude'].values\n",
    "su_date = sumup['Date'].values\n",
    "su_density = sumup['Density'].values * 1000\n",
    "su_depth = sumup['Midpoint_Depth'].values\n",
    "su_error = sumup['Error'].values * 1000\n",
    "su_error[su_error < 0] = np.nan\n",
    "su_method = sumup['Method'].values\n",
    "\n",
    "# Function to retrieve sumup data\n",
    "def get_sumup(ds_density, ds_error, ds_method, ds_depth, ds_date, ds_lat, ds_lon, tgt_lat, tgt_lon, high, low):\n",
    "    # Filter Function\n",
    "    filter_func = np.vectorize(lambda lat, lon, depth: lat == tgt_lat and lon == tgt_lon \\\n",
    "                                  and depth >= high and depth <= low)\n",
    "    # Apply filter function\n",
    "    density = ds_density[filter_func(ds_lat, ds_lon, ds_depth)] # kg/m^3\n",
    "    depth = ds_depth[filter_func(ds_lat, ds_lon, ds_depth)] # m\n",
    "    date = ds_date[filter_func(ds_lat, ds_lon, ds_depth)]\n",
    "    error = ds_error[filter_func(ds_lat, ds_lon, ds_depth)]\n",
    "    method = ds_method[filter_func(ds_lat, ds_lon, ds_depth)]\n",
    "    \n",
    "    # Filter to only return data associated with the first timestamp\n",
    "    if len(date) == 0:\n",
    "        return density, depth, date, error, method\n",
    "    else:\n",
    "        t0 = date[0]\n",
    "        filter_func = np.vectorize(lambda date: date == t0)\n",
    "        density_filter = density[filter_func(date)]\n",
    "        depth_filter = depth[filter_func(date)]\n",
    "        date_filter = date[filter_func(date)]\n",
    "        error_filter = error[filter_func(date)]\n",
    "        method_filter = method[filter_func(date)]\n",
    "\n",
    "        # Return filtered data\n",
    "        return density_filter, depth_filter, date_filter, error_filter, method_filter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<xarray.DataArray 'Method' ()>\n",
       "array(3.)\n",
       "Attributes:\n",
       "    info:     see readme"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sumup['Method'][1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Retrieve IMAU FDM inforamtion"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Get FDM grid information\n",
    "grid_txt_file = \"/pl/active/nasa_smb/IMAU_FDM/Meta_Data/IN_ll_ANT27_RACMO2.4_nor_NEW.txt\"\n",
    "grid_lon, grid_lat = np.loadtxt(grid_txt_file, delimiter = \",\", usecols = (0,1), unpack=True)\n",
    "\n",
    "# Function to retrieve FDM data\n",
    "def get_FDM(tgt_lat, tgt_lon, tgt_date, high, low):\n",
    "#     Find grid cell closest to taget lat/lon\n",
    "######### New Method\n",
    "    distance = np.zeros(len(grid_lat)); distance[:] = np.nan\n",
    "    wgs84_geod = Geod(ellps='WGS84')\n",
    "    for j in range(0, len(distance)):\n",
    "        az12,az21,distance[j] = wgs84_geod.inv(tgt_lon,tgt_lat,grid_lon[j],grid_lat[j])\n",
    "    tgt_index = np.argmin(distance)\n",
    "    print(\"   FDM index \" + str(tgt_index + 1))\n",
    "    print(\"   FDM distance from obs \" + str(distance[tgt_index] / 1000))\n",
    "    print(\"   FDM Lat \" + str(grid_lat[tgt_index]))\n",
    "    print(\"   FDM Lon \" + str(grid_lon[tgt_index]))\n",
    "######### Old Method\n",
    "#     delta_lat = tgt_lat - grid_lat\n",
    "#     delta_lon = tgt_lon - grid_lon\n",
    "#     delta_lat_lon = np.sqrt(np.power(delta_lat, 2) + np.power(delta_lon, 2))\n",
    "#     tgt_index = np.argmin(delta_lat_lon)\n",
    "#     print(tgt_index + 1)\n",
    "    \n",
    "    # Path and data retrieval\n",
    "    FDM_path = \"/pl/active/nasa_smb/IMAU_FDM/Data/ECMWF_ANT27_aprun_final_2Ddetail_\" + str(tgt_index + 1) + \".nc\"\n",
    "    FDM = xr.open_dataset(FDM_path)\n",
    "\n",
    "    # Timeseries (Antarctic FDM starts on 1979-01-01 and has 10 daily temporal resolution)\n",
    "    number_timesteps = len(FDM['time'])\n",
    "    time = pd.date_range('1979-01-01', periods = number_timesteps, freq = '10D')\n",
    "    \n",
    "    # Retrieve and print time\n",
    "    index = np.argmin(np.abs(tgt_date - time))\n",
    "    timestamp = time[index]\n",
    "\n",
    "    # Retrieve data at that time\n",
    "    FDM_density_timestamp = FDM['dens'][:, index].values\n",
    "    depth = FDM['depth'].values\n",
    "    \n",
    "    # Filter data to vertical specfification\n",
    "    filter_func = np.vectorize(lambda depth: depth >= high and depth <= low)\n",
    "    FDM_density_timestamp = FDM_density_timestamp[filter_func(depth)] # kg/m^3\n",
    "    depth = depth[filter_func(depth)]\n",
    "    \n",
    "    # Return filtered data\n",
    "    return FDM_density_timestamp, depth, timestamp"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Retrieve SNOWPACK inforamtion"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Snowpack path\n",
    "# snowpack_path = \"/projects/erke2265/1D_Snowpack/Simulations/density_profile/density_profile_\"\n",
    "snowpack_path = \"/pl/active/nasa_smb/simulations/up_to_date_simulations/density_profile_10mfl_ov_rr/density_profile_\"\n",
    "\n",
    "# Function to retrieve Snowpack data\n",
    "def get_snowpack(tgt_lat, tgt_lon, tgt_date, high, low, index):\n",
    "    \n",
    "    # profile path\n",
    "    profile_path = snowpack_path + str(index + 1) + \"/output/LAT\" + str(tgt_lat) + \"LON\" + str(tgt_lon) + \".pro\"\n",
    "    \n",
    "#     # Get model data (old method)\n",
    "#     density_mod, depth_mod = snwpck_1D.get_profile_timestamp(profile_path, '0502', tgt_date)\n",
    "    \n",
    "    # Get model data (new method)\n",
    "    !bash postprocess.sh {profile_path} {timestamp_shell} > pro_data.txt\n",
    "    depth_mod, density_mod = np.loadtxt(\"pro_data.txt\", usecols=(2, 5), unpack=True)\n",
    "\n",
    "    # Return filtered data\n",
    "    return density_mod, depth_mod\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Execute Retrievals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Working on site 1 of 124\n",
      "   tgt lat -89.9333\n",
      "   tgt lon 144.3938\n",
      "   SUMup\n",
      "   2002-01-01\n",
      "   FDM\n",
      "   FDM index 8234\n",
      "   FDM distance from obs 7.449988402571542\n",
      "   FDM Lat -90.0\n",
      "   FDM Lon -170.0\n",
      "   SNOWPACK\n",
      "Working on site 2 of 124\n",
      "   tgt lat -88.5095\n",
      "   tgt lon 178.5308\n",
      "   SUMup\n",
      "   2007-01-01\n",
      "   FDM\n",
      "   FDM index 7253\n",
      "   FDM distance from obs 6.7920476593851475\n",
      "   FDM Lat -88.4793\n",
      "   FDM Lon -179.4602\n",
      "   SNOWPACK\n",
      "Working on site 3 of 124\n",
      "   tgt lat -88.0022\n",
      "   tgt lon -107.9833\n",
      "   SUMup\n",
      "   2002-01-01\n",
      "   FDM\n",
      "   FDM index 7572\n",
      "   FDM distance from obs 7.191013677882909\n",
      "   FDM Lat -87.9845\n",
      "   FDM Lon -109.7512\n",
      "   SNOWPACK\n",
      "Working on site 4 of 124\n",
      "   tgt lat -86.84\n",
      "   tgt lon 95.31\n",
      "   SUMup\n",
      "   2003-01-01\n",
      "   FDM\n",
      "   FDM index 8413\n",
      "   FDM distance from obs 11.270099996095066\n",
      "   FDM Lat -86.7404\n",
      "   FDM Lon 95.5989\n",
      "   SNOWPACK\n",
      "Working on site 5 of 124\n",
      "   tgt lat -86.5025\n",
      "   tgt lon -107.9903\n",
      "   SUMup\n",
      "   2002-01-01\n",
      "   FDM\n",
      "   FDM index 7078\n",
      "   FDM distance from obs 15.760639140560938\n",
      "   FDM Lat -86.5273\n",
      "   FDM Lon -110.2756\n",
      "   SNOWPACK\n",
      "Working on site 6 of 124\n",
      "   tgt lat -85.7819\n",
      "   tgt lon 145.7195\n",
      "   SUMup\n",
      "   2007-01-01\n",
      "   FDM\n",
      "   FDM index 6289\n",
      "   FDM distance from obs 6.1925717466201435\n",
      "   FDM Lat -85.7583\n",
      "   FDM Lon 145.0393\n",
      "   SNOWPACK\n",
      "Working on site 7 of 124\n",
      "   tgt lat -85.0005\n",
      "   tgt lon -104.9953\n",
      "   SUMup\n",
      "   2002-01-01\n",
      "   FDM\n",
      "   FDM index 6909\n",
      "   FDM distance from obs 12.868297477161214\n",
      "   FDM Lat -85.0764\n",
      "   FDM Lon -103.993\n",
      "   SNOWPACK\n",
      "Working on site 8 of 124\n",
      "   tgt lat -84.81833\n",
      "   tgt lon -59.635\n",
      "   SUMup\n",
      "   1995-02-17\n",
      "   FDM\n",
      "   FDM index 9391\n",
      "   FDM distance from obs 13.479597596802444\n",
      "   FDM Lat -84.9386\n",
      "   FDM Lon -59.7481\n",
      "   SNOWPACK\n",
      "Working on site 9 of 124\n",
      "   tgt lat -84.3951\n",
      "   tgt lon 140.6308\n",
      "   SUMup\n",
      "   2007-01-01\n",
      "   FDM\n",
      "   FDM index 5813\n",
      "   FDM distance from obs 11.611757562842428\n",
      "   FDM Lat -84.3344\n",
      "   FDM Lon 141.4904\n",
      "   SNOWPACK\n",
      "Working on site 10 of 124\n",
      "   tgt lat -83.91833\n",
      "   tgt lon -60.36\n",
      "   SUMup\n",
      "   1995-02-17\n",
      "   FDM\n",
      "   FDM index 9559\n",
      "   FDM distance from obs 5.050737294914044\n",
      "   FDM Lat -83.9132\n",
      "   FDM Lon -60.7839\n",
      "   SNOWPACK\n",
      "Working on site 11 of 124\n",
      "   tgt lat -83.5008\n",
      "   tgt lon -104.9868\n",
      "   SUMup\n",
      "   2002-01-01\n",
      "   FDM\n",
      "   FDM index 6415\n",
      "   FDM distance from obs 11.71601594469628\n",
      "   FDM Lat -83.4019\n",
      "   FDM Lon -104.68\n",
      "   SNOWPACK\n",
      "Working on site 12 of 124\n",
      "   tgt lat -83.385\n",
      "   tgt lon -60.06333\n",
      "   SUMup\n",
      "   1995-02-09\n",
      "   FDM\n",
      "   FDM index 9730\n",
      "   FDM distance from obs 3.1580484418158306\n",
      "   FDM Lat -83.3588\n",
      "   FDM Lon -60.1555\n",
      "   SNOWPACK\n",
      "Working on site 13 of 124\n",
      "   tgt lat -83.16667\n",
      "   tgt lon -59.575\n",
      "   SUMup\n",
      "   1995-02-03\n",
      "   FDM\n",
      "   FDM index 9902\n",
      "   FDM distance from obs 16.947693949373544\n",
      "   FDM Lat -83.0377\n",
      "   FDM Lon -58.9091\n",
      "   SNOWPACK\n",
      "Working on site 14 of 124\n",
      "   tgt lat -82.75\n",
      "   tgt lon -58.69167\n",
      "   SUMup\n",
      "   1995-02-11\n",
      "   FDM\n",
      "   FDM index 10075\n",
      "   FDM distance from obs 13.613747382732631\n",
      "   FDM Lat -82.7137\n",
      "   FDM Lon -57.7719\n",
      "   SNOWPACK\n",
      "Working on site 15 of 124\n",
      "   tgt lat -82.335\n",
      "   tgt lon -57.82667\n",
      "   SUMup\n",
      "   1995-02-18\n",
      "   FDM\n",
      "   FDM index 10251\n",
      "   FDM distance from obs 17.283729449903497\n",
      "   FDM Lat -82.3872\n",
      "   FDM Lon -56.7307\n",
      "   SNOWPACK\n",
      "Working on site 16 of 124\n",
      "   tgt lat -82.08\n",
      "   tgt lon 101.96\n",
      "   SUMup\n",
      "   2003-01-01\n",
      "   FDM\n",
      "   FDM index 8099\n",
      "   FDM distance from obs 9.707953987242242\n",
      "   FDM Lat -81.9961\n",
      "   FDM Lon 101.7957\n",
      "   SNOWPACK\n",
      "Working on site 17 of 124\n",
      "   tgt lat -82.001\n",
      "   tgt lon -110.0082\n",
      "   SUMup\n",
      "   2002-01-01\n",
      "   FDM\n",
      "   FDM index 5607\n",
      "   FDM distance from obs 6.981396862136822\n",
      "   FDM Lat -81.9427\n",
      "   FDM Lon -109.8466\n",
      "   SNOWPACK\n",
      "Working on site 18 of 124\n",
      "   tgt lat -81.658\n",
      "   tgt lon 136.084\n",
      "   SUMup\n",
      "   2007-01-01\n",
      "   FDM\n",
      "   FDM index 5012\n",
      "   FDM distance from obs 11.00449075324226\n",
      "   FDM Lat -81.6067\n",
      "   FDM Lon 136.6621\n",
      "   SNOWPACK\n",
      "Working on site 19 of 124\n",
      "   tgt lat -81.65\n",
      "   tgt lon 122.6\n",
      "   SUMup\n",
      "   2003-01-01\n",
      "   FDM\n",
      "   FDM index 6147\n",
      "   FDM distance from obs 6.7704431509985135\n",
      "   FDM Lat -81.6\n",
      "   FDM Lon 122.8354\n",
      "   SNOWPACK\n",
      "Working on site 20 of 124\n",
      "   tgt lat -81.605\n",
      "   tgt lon -57.88833\n",
      "   SUMup\n",
      "   1995-02-19\n",
      "   FDM\n",
      "   FDM index 10424\n",
      "   FDM distance from obs 11.817591799993671\n",
      "   FDM Lat -81.6\n",
      "   FDM Lon -57.1646\n",
      "   SNOWPACK\n",
      "Working on site 21 of 124\n",
      "   tgt lat -81.21833\n",
      "   tgt lon -57.20333\n",
      "   SUMup\n",
      "   1995-02-19\n",
      "   FDM\n",
      "   FDM index 10600\n",
      "   FDM distance from obs 16.88170062266005\n",
      "   FDM Lat -81.2724\n",
      "   FDM Lon -56.2759\n",
      "   SNOWPACK\n",
      "Working on site 22 of 124\n",
      "   tgt lat -81.2\n",
      "   tgt lon -126.17\n",
      "   SUMup\n",
      "   1999-01-01\n",
      "   FDM\n",
      "   FDM index 4161\n",
      "   FDM distance from obs 16.366372295353\n",
      "   FDM Lat -81.3444\n",
      "   FDM Lon -126.3353\n",
      "   SNOWPACK\n",
      "Working on site 23 of 124\n",
      "   tgt lat -80.83333\n",
      "   tgt lon -56.58833\n",
      "   SUMup\n",
      "   1995-02-20\n",
      "   FDM\n",
      "   FDM index 10769\n",
      "   FDM distance from obs 15.97486836058047\n",
      "   FDM Lat -80.7151\n",
      "   FDM Lon -56.086\n",
      "   SNOWPACK\n",
      "Working on site 24 of 124\n",
      "   tgt lat -80.62\n",
      "   tgt lon -122.63\n",
      "   SUMup\n",
      "   1999-01-01\n",
      "   FDM\n",
      "   FDM index 4157\n",
      "   FDM distance from obs 12.494622127060818\n",
      "   FDM Lat -80.6262\n",
      "   FDM Lon -121.9444\n",
      "   SNOWPACK\n",
      "Working on site 25 of 124\n",
      "   tgt lat -80.43\n",
      "   tgt lon -55.98\n",
      "   SUMup\n",
      "   1995-02-20\n",
      "   FDM\n",
      "   FDM index 10940\n",
      "   FDM distance from obs 13.36893920244925\n",
      "   FDM Lat -80.3855\n",
      "   FDM Lon -55.3131\n",
      "   SNOWPACK\n",
      "Working on site 26 of 124\n",
      "   tgt lat -80.39\n",
      "   tgt lon 138.92\n",
      "   SUMup\n",
      "   2003-01-01\n",
      "   FDM\n",
      "   FDM index 4369\n",
      "   FDM distance from obs 2.300555137374229\n",
      "   FDM Lat -80.406\n",
      "   FDM Lon 138.8422\n",
      "   SNOWPACK\n",
      "Working on site 27 of 124\n",
      "   tgt lat -80.0\n",
      "   tgt lon -55.5\n",
      "   SUMup\n",
      "   1995-02-20\n",
      "   FDM\n",
      "   FDM index 11113\n",
      "   FDM distance from obs 18.615288887189543\n",
      "   FDM Lat -80.0545\n",
      "   FDM Lon -54.5904\n",
      "   SNOWPACK\n",
      "Working on site 28 of 124\n",
      "   tgt lat -79.67\n",
      "   tgt lon -54.89167\n",
      "   SUMup\n",
      "   1995-02-21\n",
      "   FDM\n",
      "   FDM index 11112\n",
      "   FDM distance from obs 18.612159767128798\n",
      "   FDM Lat -79.8281\n",
      "   FDM Lon -55.1884\n",
      "   SNOWPACK\n",
      "Working on site 29 of 124\n",
      "   tgt lat -79.658\n",
      "   tgt lon -45.617\n",
      "   SUMup\n",
      "   1990-01-06\n",
      "   FDM\n",
      "   FDM index 12165\n",
      "   FDM distance from obs 10.508710390074242\n",
      "   FDM Lat -79.7497\n",
      "   FDM Lon -45.7355\n",
      "   SNOWPACK\n",
      "Working on site 30 of 124\n",
      "   tgt lat -79.61416\n",
      "   tgt lon -45.72433\n",
      "   SUMup\n",
      "   1995-02-08\n",
      "   FDM\n",
      "   FDM index 12165\n",
      "   FDM distance from obs 15.13574268735801\n",
      "   FDM Lat -79.7497\n",
      "   FDM Lon -45.7355\n",
      "   SNOWPACK\n",
      "Working on site 31 of 124\n",
      "   tgt lat -79.4468\n",
      "   tgt lon -117.9635\n",
      "   SUMup\n",
      "   2011-12-27\n",
      "   FDM\n",
      "   FDM index 4000\n",
      "   FDM distance from obs 12.24305241144502\n",
      "   FDM Lat -79.511\n",
      "   FDM Lon -118.4502\n",
      "   SNOWPACK\n",
      "Working on site 32 of 124\n",
      "   tgt lat -79.3831\n",
      "   tgt lon -111.239\n",
      "   SUMup\n",
      "   2000-01-01\n",
      "   FDM\n",
      "   FDM index 4622\n",
      "   FDM distance from obs 11.877222148782154\n",
      "   FDM Lat -79.4643\n",
      "   FDM Lon -111.6133\n",
      "   SNOWPACK\n",
      "Working on site 33 of 124\n",
      "   tgt lat -79.3479\n",
      "   tgt lon -116.2905\n",
      "   SUMup\n",
      "   2011-12-12\n",
      "   FDM\n",
      "   FDM index 4151\n",
      "   FDM distance from obs 13.81673323622634\n",
      "   FDM Lat -79.4631\n",
      "   FDM Lon -116.5362\n",
      "   SNOWPACK\n",
      "Working on site 34 of 124\n",
      "   tgt lat -79.26833\n",
      "   tgt lon -54.20167\n",
      "   SUMup\n",
      "   1995-02-21\n",
      "   FDM\n",
      "   FDM index 11462\n",
      "   FDM distance from obs 13.556388933883095\n",
      "   FDM Lat -79.1646\n",
      "   FDM Lon -53.8645\n",
      "   SNOWPACK\n",
      "Working on site 35 of 124\n",
      "   tgt lat -79.1597\n",
      "   tgt lon -104.9672\n",
      "   SUMup\n",
      "   2001-01-01\n",
      "   FDM\n",
      "   FDM index 5272\n",
      "   FDM distance from obs 12.43508830498688\n",
      "   FDM Lat -79.2708\n",
      "   FDM Lon -104.9257\n",
      "   SNOWPACK\n",
      "Working on site 36 of 124\n",
      "   tgt lat -79.133\n",
      "   tgt lon -122.267\n",
      "   SUMup\n",
      "   2000-01-01\n",
      "   FDM\n",
      "   FDM index 3568\n",
      "   FDM distance from obs 10.245219671492757\n",
      "   FDM Lat -79.2195\n",
      "   FDM Lon -122.43\n",
      "   SNOWPACK\n",
      "Working on site 37 of 124\n",
      "   tgt lat -79.0362\n",
      "   tgt lon 149.6803\n",
      "   SUMup\n",
      "   2006-01-01\n",
      "   FDM\n",
      "   FDM index 3063\n",
      "   FDM distance from obs 15.210422273021221\n",
      "   FDM Lat -79.0336\n",
      "   FDM Lon 148.9644\n",
      "   SNOWPACK\n",
      "Working on site 38 of 124\n",
      "   tgt lat -78.94611\n",
      "   tgt lon -56.84\n",
      "   SUMup\n",
      "   1984-02-09\n",
      "   FDM\n",
      "   FDM index 11108\n",
      "   FDM distance from obs 11.230628345275779\n",
      "   FDM Lat -78.9125\n",
      "   FDM Lon -57.3336\n",
      "   SNOWPACK\n",
      "Working on site 39 of 124\n",
      "   tgt lat -78.84\n",
      "   tgt lon -53.47333\n",
      "   SUMup\n",
      "   1995-02-21\n",
      "   FDM\n",
      "   FDM index 11639\n",
      "   FDM distance from obs 4.725486444547949\n",
      "   FDM Lat -78.831\n",
      "   FDM Lon -53.2598\n",
      "   SNOWPACK\n",
      "Working on site 40 of 124\n",
      "   tgt lat -78.8369\n",
      "   tgt lon -116.3071\n",
      "   SUMup\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   2011-12-23\n",
      "   FDM\n",
      "   FDM index 3997\n",
      "   FDM distance from obs 10.034962171740544\n",
      "   FDM Lat -78.9139\n",
      "   FDM Lon -116.0669\n",
      "   SNOWPACK\n",
      "Working on site 41 of 124\n",
      "   tgt lat -78.733\n",
      "   tgt lon -111.4966\n",
      "   SUMup\n",
      "   2000-01-01\n",
      "   FDM\n",
      "   FDM index 4458\n",
      "   FDM distance from obs 17.168029628672542\n",
      "   FDM Lat -78.6949\n",
      "   FDM Lon -110.7356\n",
      "   SNOWPACK\n",
      "Working on site 42 of 124\n",
      "   tgt lat -78.728\n",
      "   tgt lon -114.7322\n",
      "   SUMup\n",
      "   2011-12-14\n",
      "   FDM\n",
      "   FDM index 3996\n",
      "   FDM distance from obs 13.18317216462364\n",
      "   FDM Lat -78.7109\n",
      "   FDM Lon -115.3293\n",
      "   SNOWPACK\n",
      "Working on site 43 of 124\n",
      "   tgt lat -78.60611\n",
      "   tgt lon -55.43167\n",
      "   SUMup\n",
      "   1984-01-28\n",
      "   FDM\n",
      "   FDM index 11459\n",
      "   FDM distance from obs 13.402613674829663\n",
      "   FDM Lat -78.4866\n",
      "   FDM Lon -55.4885\n",
      "   SNOWPACK\n",
      "Working on site 44 of 124\n",
      "   tgt lat -78.433\n",
      "   tgt lon -115.9172\n",
      "   SUMup\n",
      "   2000-01-01\n",
      "   FDM\n",
      "   FDM index 3846\n",
      "   FDM distance from obs 9.82867104484657\n",
      "   FDM Lat -78.3641\n",
      "   FDM Lon -115.6448\n",
      "   SNOWPACK\n",
      "Working on site 45 of 124\n",
      "   tgt lat -78.4243\n",
      "   tgt lon -115.292\n",
      "   SUMup\n",
      "   2011-12-19\n",
      "   FDM\n",
      "   FDM index 3846\n",
      "   FDM distance from obs 10.392429058889807\n",
      "   FDM Lat -78.3641\n",
      "   FDM Lon -115.6448\n",
      "   SNOWPACK\n",
      "Working on site 46 of 124\n",
      "   tgt lat -78.41333\n",
      "   tgt lon -52.47333\n",
      "   SUMup\n",
      "   1995-02-22\n",
      "   FDM\n",
      "   FDM index 11814\n",
      "   FDM distance from obs 10.461453008366258\n",
      "   FDM Lat -78.4965\n",
      "   FDM Lon -52.6889\n",
      "   SNOWPACK\n",
      "Working on site 47 of 124\n",
      "   tgt lat -78.3325\n",
      "   tgt lon -124.484\n",
      "   SUMup\n",
      "   2000-01-01\n",
      "   FDM\n",
      "   FDM index 3000\n",
      "   FDM distance from obs 17.51330490910621\n",
      "   FDM Lat -78.1758\n",
      "   FDM Lon -124.4489\n",
      "   SNOWPACK\n",
      "Working on site 48 of 124\n",
      "   tgt lat -78.3109\n",
      "   tgt lon -113.7884\n",
      "   SUMup\n",
      "   2011-12-16\n",
      "   FDM\n",
      "   FDM index 3994\n",
      "   FDM distance from obs 3.495072838720414\n",
      "   FDM Lat -78.2994\n",
      "   FDM Lon -113.932\n",
      "   SNOWPACK\n",
      "Working on site 49 of 124\n",
      "   tgt lat -78.3\n",
      "   tgt lon -46.283\n",
      "   SUMup\n",
      "   1990-01-06\n",
      "   FDM\n",
      "   FDM index 12625\n",
      "   FDM distance from obs 4.869682235669166\n",
      "   FDM Lat -78.2994\n",
      "   FDM Lon -46.068\n",
      "   SNOWPACK\n",
      "Working on site 50 of 124\n",
      "   tgt lat -78.24194\n",
      "   tgt lon -54.04694\n",
      "   SUMup\n",
      "   1984-01-30\n",
      "   FDM\n",
      "   FDM index 11637\n",
      "   FDM distance from obs 17.160938372740763\n",
      "   FDM Lat -78.3824\n",
      "   FDM Lon -54.355\n",
      "   SNOWPACK\n",
      "Working on site 51 of 124\n",
      "   tgt lat -78.1202\n",
      "   tgt lon -95.6463\n",
      "   SUMup\n",
      "   2001-01-01\n",
      "   FDM\n",
      "   FDM index 6070\n",
      "   FDM distance from obs 9.266583455361644\n",
      "   FDM Lat -78.0555\n",
      "   FDM Lon -95.8981\n",
      "   SNOWPACK\n",
      "Working on site 52 of 124\n",
      "   tgt lat -78.0829\n",
      "   tgt lon -120.0764\n",
      "   SUMup\n",
      "   2000-01-01\n",
      "   FDM\n",
      "   FDM index 3281\n",
      "   FDM distance from obs 14.941937225772786\n",
      "   FDM Lat -77.9542\n",
      "   FDM Lon -120.2532\n",
      "   SNOWPACK\n",
      "Working on site 53 of 124\n",
      "   tgt lat -77.99167\n",
      "   tgt lon -51.53333\n",
      "   SUMup\n",
      "   1995-02-22\n",
      "   FDM\n",
      "   FDM index 12157\n",
      "   FDM distance from obs 12.096684877914779\n",
      "   FDM Lat -78.0442\n",
      "   FDM Lon -51.077\n",
      "   SNOWPACK\n",
      "Working on site 54 of 124\n",
      "   tgt lat -77.957\n",
      "   tgt lon -95.962\n",
      "   SUMup\n",
      "   2010-12-22\n",
      "   FDM\n",
      "   FDM index 6070\n",
      "   FDM distance from obs 11.096590046213665\n",
      "   FDM Lat -78.0555\n",
      "   FDM Lon -95.8981\n",
      "   SNOWPACK\n",
      "Working on site 55 of 124\n",
      "   tgt lat -77.9375\n",
      "   tgt lon -55.97833\n",
      "   SUMup\n",
      "   1990-02-07\n",
      "   FDM\n",
      "   FDM index 11635\n",
      "   FDM distance from obs 14.277398654996299\n",
      "   FDM Lat -77.9297\n",
      "   FDM Lon -55.3679\n",
      "   SNOWPACK\n",
      "Working on site 56 of 124\n",
      "   tgt lat -77.935\n",
      "   tgt lon -55.93611\n",
      "   SUMup\n",
      "   1992-01-29\n",
      "   FDM\n",
      "   FDM index 11635\n",
      "   FDM distance from obs 13.279719054842058\n",
      "   FDM Lat -77.9297\n",
      "   FDM Lon -55.3679\n",
      "   SNOWPACK\n",
      "Working on site 57 of 124\n",
      "   tgt lat -77.8802\n",
      "   tgt lon 158.4582\n",
      "   SUMup\n",
      "   2006-01-01\n",
      "   FDM\n",
      "   FDM index 1948\n",
      "   FDM distance from obs 11.85748638327167\n",
      "   FDM Lat -77.8814\n",
      "   FDM Lon 157.9525\n",
      "   SNOWPACK\n",
      "Working on site 58 of 124\n",
      "   tgt lat -77.88\n",
      "   tgt lon 158.66\n",
      "   SUMup\n",
      "   2003-01-01\n",
      "   FDM\n",
      "   FDM index 1947\n",
      "   FDM distance from obs 16.238128756432186\n",
      "   FDM Lat -78.0122\n",
      "   FDM Lon 158.9503\n",
      "   SNOWPACK\n",
      "Working on site 59 of 124\n",
      "   tgt lat -77.86722\n",
      "   tgt lon -52.80417\n",
      "   SUMup\n",
      "   1984-01-27\n",
      "   FDM\n",
      "   FDM index 11985\n",
      "   FDM distance from obs 8.45812188854543\n",
      "   FDM Lat -77.9395\n",
      "   FDM Lon -52.6959\n",
      "   SNOWPACK\n",
      "Working on site 60 of 124\n",
      "   tgt lat -77.8436\n",
      "   tgt lon -102.9103\n",
      "   SUMup\n",
      "   2001-01-01\n",
      "   FDM\n",
      "   FDM index 5104\n",
      "   FDM distance from obs 6.1388324042133515\n",
      "   FDM Lat -77.8002\n",
      "   FDM Lon -103.0703\n",
      "   SNOWPACK\n",
      "Working on site 61 of 124\n",
      "   tgt lat -77.7619\n",
      "   tgt lon 153.3814\n",
      "   SUMup\n",
      "   2006-01-01\n",
      "   FDM\n",
      "   FDM index 2224\n",
      "   FDM distance from obs 14.362898700486337\n",
      "   FDM Lat -77.8709\n",
      "   FDM Lon 153.7051\n",
      "   SNOWPACK\n",
      "Working on site 62 of 124\n",
      "   tgt lat -77.683\n",
      "   tgt lon -123.995\n",
      "   SUMup\n",
      "   2000-01-01\n",
      "   FDM\n",
      "   FDM index 2856\n",
      "   FDM distance from obs 8.397190164072194\n",
      "   FDM Lat -77.6447\n",
      "   FDM Lon -123.6921\n",
      "   SNOWPACK\n",
      "Working on site 63 of 124\n",
      "   tgt lat -77.6116\n",
      "   tgt lon -92.2483\n",
      "   SUMup\n",
      "   2001-01-01\n",
      "   FDM\n",
      "   FDM index 6553\n",
      "   FDM distance from obs 17.643108387516442\n",
      "   FDM Lat -77.7461\n",
      "   FDM Lon -91.8596\n",
      "   SNOWPACK\n",
      "Working on site 64 of 124\n",
      "   tgt lat -77.57861\n",
      "   tgt lon -50.57944\n",
      "   SUMup\n",
      "   1984-01-24\n",
      "   FDM\n",
      "   FDM index 12320\n",
      "   FDM distance from obs 14.241107359902486\n",
      "   FDM Lat -77.7061\n",
      "   FDM Lon -50.5992\n",
      "   SNOWPACK\n",
      "Working on site 65 of 124\n",
      "   tgt lat -77.355\n",
      "   tgt lon -56.04\n",
      "   SUMup\n",
      "   1986-02-07\n",
      "   FDM\n",
      "   FDM index 11633\n",
      "   FDM distance from obs 14.73550660135188\n",
      "   FDM Lat -77.4735\n",
      "   FDM Lon -56.3067\n",
      "   SNOWPACK\n",
      "Working on site 66 of 124\n",
      "   tgt lat -77.12917\n",
      "   tgt lon -50.50139\n",
      "   SUMup\n",
      "   1984-01-22\n",
      "   FDM\n",
      "   FDM index 12475\n",
      "   FDM distance from obs 28.014157953142167\n",
      "   FDM Lat -77.3675\n",
      "   FDM Lon -50.1457\n",
      "   SNOWPACK\n",
      "Working on site 67 of 124\n",
      "   tgt lat -77.0593\n",
      "   tgt lon -89.1376\n",
      "   SUMup\n",
      "   2001-01-01\n",
      "   FDM\n",
      "   FDM index 6876\n",
      "   FDM distance from obs 5.5480954460886895\n",
      "   FDM Lat -77.0967\n",
      "   FDM Lon -88.9913\n",
      "   SNOWPACK\n",
      "Working on site 68 of 124\n",
      "   tgt lat -76.952\n",
      "   tgt lon -121.22\n",
      "   SUMup\n",
      "   2011-01-14\n",
      "   FDM\n",
      "   FDM index 2852\n",
      "   FDM distance from obs 13.799422553875797\n",
      "   FDM Lat -76.9037\n",
      "   FDM Lon -120.7171\n",
      "   SNOWPACK\n",
      "Working on site 69 of 124\n",
      "   tgt lat -76.77\n",
      "   tgt lon -101.738\n",
      "   SUMup\n",
      "   2010-12-31\n",
      "   FDM\n",
      "   FDM index 5100\n",
      "   FDM distance from obs 14.704322928030534\n",
      "   FDM Lat -76.8745\n",
      "   FDM Lon -101.3864\n",
      "   SNOWPACK\n",
      "Working on site 70 of 124\n",
      "   tgt lat -76.0973\n",
      "   tgt lon -89.0177\n",
      "   SUMup\n",
      "   2001-01-01\n",
      "   FDM\n",
      "   FDM index 6709\n",
      "   FDM distance from obs 10.338471226902193\n",
      "   FDM Lat -76.0706\n",
      "   FDM Lon -89.3863\n",
      "   SNOWPACK\n",
      "Working on site 71 of 124\n",
      "   tgt lat -75.933333\n",
      "   tgt lon 7.213\n",
      "   SUMup\n",
      "   1997-01-28\n",
      "   FDM\n",
      "   FDM index 16115\n",
      "   FDM distance from obs 7.902321730232731\n",
      "   FDM Lat -75.9803\n",
      "   FDM Lon 6.9948\n",
      "   SNOWPACK\n",
      "Working on site 72 of 124\n",
      "   tgt lat -75.752833\n",
      "   tgt lon 3.282833\n",
      "   SUMup\n",
      "   1997-01-22\n",
      "   FDM\n",
      "   FDM index 16217\n",
      "   FDM distance from obs 12.616001781601167\n",
      "   FDM Lat -75.6452\n",
      "   FDM Lon 3.1433\n",
      "   SNOWPACK\n",
      "Working on site 73 of 124\n",
      "   tgt lat -75.5815\n",
      "   tgt lon -3.430333\n",
      "   SUMup\n",
      "   1997-12-19\n",
      "   FDM\n",
      "   FDM index 16104\n",
      "   FDM distance from obs 9.131121851964659\n",
      "   FDM Lat -75.5776\n",
      "   FDM Lon -3.7583\n",
      "   SNOWPACK\n",
      "Working on site 74 of 124\n",
      "   tgt lat -75.272163\n",
      "   tgt lon 0.537226\n",
      "   SUMup\n",
      "   2006-01-05\n",
      "   FDM\n",
      "   FDM index 16319\n",
      "   FDM distance from obs 3.757961665070653\n",
      "   FDM Lat -75.2906\n",
      "   FDM Lon 0.4264\n",
      "   SNOWPACK\n",
      "Working on site 75 of 124\n",
      "   tgt lat -75.265114\n",
      "   tgt lon 6.248196\n",
      "   SUMup\n",
      "   2006-01-06\n",
      "   FDM\n",
      "   FDM index 16430\n",
      "   FDM distance from obs 5.504801391027548\n",
      "   FDM Lat -75.2169\n",
      "   FDM Lon 6.2075\n",
      "   SNOWPACK\n",
      "Working on site 76 of 124\n",
      "   tgt lat -75.25647\n",
      "   tgt lon 6.956798\n",
      "   SUMup\n",
      "   2006-01-06\n",
      "   FDM\n",
      "   FDM index 16431\n",
      "   FDM distance from obs 6.260624236736591\n",
      "   FDM Lat -75.2314\n",
      "   FDM Lon 7.1537\n",
      "   SNOWPACK\n",
      "Working on site 77 of 124\n",
      "   tgt lat -75.250833\n",
      "   tgt lon 6.501667\n",
      "   SUMup\n",
      "   1998-01-11\n",
      "   FDM\n",
      "   FDM index 16430\n",
      "   FDM distance from obs 9.189365816202626\n",
      "   FDM Lat -75.2169\n",
      "   FDM Lon 6.2075\n",
      "   SNOWPACK\n",
      "Working on site 78 of 124\n",
      "   tgt lat -75.250333\n",
      "   tgt lon -6.0\n",
      "   SUMup\n",
      "   1997-12-17\n",
      "   FDM\n",
      "   FDM index 16207\n",
      "   FDM distance from obs 14.269587983807293\n",
      "   FDM Lat -75.1423\n",
      "   FDM Lon -6.2674\n",
      "   SNOWPACK\n",
      "Working on site 79 of 124\n",
      "   tgt lat -75.247444\n",
      "   tgt lon 4.833094\n",
      "   SUMup\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   2006-01-04\n",
      "   FDM\n",
      "   FDM index 16429\n",
      "   FDM distance from obs 13.42767983357409\n",
      "   FDM Lat -75.1983\n",
      "   FDM Lon 5.2634\n",
      "   SNOWPACK\n",
      "Working on site 80 of 124\n",
      "   tgt lat -75.236252\n",
      "   tgt lon 3.424011\n",
      "   SUMup\n",
      "   2006-01-03\n",
      "   FDM\n",
      "   FDM index 16427\n",
      "   FDM distance from obs 9.829310916318686\n",
      "   FDM Lat -75.1488\n",
      "   FDM Lon 3.3836\n",
      "   SNOWPACK\n",
      "Working on site 81 of 124\n",
      "   tgt lat -75.231415\n",
      "   tgt lon 2.713953\n",
      "   SUMup\n",
      "   2006-01-03\n",
      "   FDM\n",
      "   FDM index 16426\n",
      "   FDM distance from obs 14.750331785598256\n",
      "   FDM Lat -75.118\n",
      "   FDM Lon 2.449\n",
      "   SNOWPACK\n",
      "Working on site 82 of 124\n",
      "   tgt lat -75.227753\n",
      "   tgt lon 7.655268\n",
      "   SUMup\n",
      "   2006-01-06\n",
      "   FDM\n",
      "   FDM index 16432\n",
      "   FDM distance from obs 12.797647912524264\n",
      "   FDM Lat -75.2417\n",
      "   FDM Lon 8.1016\n",
      "   SNOWPACK\n",
      "Working on site 83 of 124\n",
      "   tgt lat -75.227386\n",
      "   tgt lon 4.131404\n",
      "   SUMup\n",
      "   2006-01-04\n",
      "   FDM\n",
      "   FDM index 16428\n",
      "   FDM distance from obs 7.933158929949152\n",
      "   FDM Lat -75.1756\n",
      "   FDM Lon 4.3219\n",
      "   SNOWPACK\n",
      "Working on site 84 of 124\n",
      "   tgt lat -75.20372\n",
      "   tgt lon 2.012168\n",
      "   SUMup\n",
      "   2006-01-03\n",
      "   FDM\n",
      "   FDM index 16426\n",
      "   FDM distance from obs 15.736009329690448\n",
      "   FDM Lat -75.118\n",
      "   FDM Lon 2.449\n",
      "   SNOWPACK\n",
      "Working on site 85 of 124\n",
      "   tgt lat -75.181969\n",
      "   tgt lon 8.337033\n",
      "   SUMup\n",
      "   2006-01-07\n",
      "   FDM\n",
      "   FDM index 16432\n",
      "   FDM distance from obs 9.459565354134975\n",
      "   FDM Lat -75.2417\n",
      "   FDM Lon 8.1016\n",
      "   SNOWPACK\n",
      "Working on site 86 of 124\n",
      "   tgt lat -75.167333\n",
      "   tgt lon -0.995\n",
      "   SUMup\n",
      "   1997-12-23\n",
      "   FDM\n",
      "   FDM index 16317\n",
      "   FDM distance from obs 13.210454468419062\n",
      "   FDM Lat -75.1994\n",
      "   FDM Lon -1.4403\n",
      "   SNOWPACK\n",
      "Working on site 87 of 124\n",
      "   tgt lat -75.167333\n",
      "   tgt lon 5.003333\n",
      "   SUMup\n",
      "   1998-01-12\n",
      "   FDM\n",
      "   FDM index 16429\n",
      "   FDM distance from obs 8.191896540939716\n",
      "   FDM Lat -75.1983\n",
      "   FDM Lon 5.2634\n",
      "   SNOWPACK\n",
      "Working on site 88 of 124\n",
      "   tgt lat -75.167\n",
      "   tgt lon 6.4985\n",
      "   SUMup\n",
      "   1998-01-07\n",
      "   FDM\n",
      "   FDM index 16430\n",
      "   FDM distance from obs 10.000068617519991\n",
      "   FDM Lat -75.2169\n",
      "   FDM Lon 6.2075\n",
      "   SNOWPACK\n",
      "Working on site 89 of 124\n",
      "   tgt lat -75.146835\n",
      "   tgt lon 1.34037\n",
      "   SUMup\n",
      "   2006-01-02\n",
      "   FDM\n",
      "   FDM index 16425\n",
      "   FDM distance from obs 8.760644783726828\n",
      "   FDM Lat -75.0831\n",
      "   FDM Lon 1.5186\n",
      "   SNOWPACK\n",
      "Working on site 90 of 124\n",
      "   tgt lat -75.142113\n",
      "   tgt lon 9.026305\n",
      "   SUMup\n",
      "   2006-01-07\n",
      "   FDM\n",
      "   FDM index 16433\n",
      "   FDM distance from obs 11.828141915620282\n",
      "   FDM Lat -75.2479\n",
      "   FDM Lon 9.0505\n",
      "   SNOWPACK\n",
      "Working on site 91 of 124\n",
      "   tgt lat -75.116913\n",
      "   tgt lon 9.723999\n",
      "   SUMup\n",
      "   2006-01-08\n",
      "   FDM\n",
      "   FDM index 16539\n",
      "   FDM distance from obs 15.278826640597165\n",
      "   FDM Lat -75.0\n",
      "   FDM Lon 10.0\n",
      "   SNOWPACK\n",
      "Working on site 92 of 124\n",
      "   tgt lat -75.084\n",
      "   tgt lon 6.5\n",
      "   SUMup\n",
      "   1998-01-06\n",
      "   FDM\n",
      "   FDM index 16535\n",
      "   FDM distance from obs 14.554738834457549\n",
      "   FDM Lat -74.9675\n",
      "   FDM Lon 6.2734\n",
      "   SNOWPACK\n",
      "Working on site 93 of 124\n",
      "   tgt lat -75.083667\n",
      "   tgt lon 2.501\n",
      "   SUMup\n",
      "   1998-01-14\n",
      "   FDM\n",
      "   FDM index 16426\n",
      "   FDM distance from obs 4.112799861663043\n",
      "   FDM Lat -75.118\n",
      "   FDM Lon 2.449\n",
      "   SNOWPACK\n",
      "Working on site 94 of 124\n",
      "   tgt lat -75.06028\n",
      "   tgt lon 0.722052\n",
      "   SUMup\n",
      "   2006-01-02\n",
      "   FDM\n",
      "   FDM index 16424\n",
      "   FDM distance from obs 4.128149987411032\n",
      "   FDM Lat -75.0443\n",
      "   FDM Lon 0.5928\n",
      "   SNOWPACK\n",
      "Working on site 95 of 124\n",
      "   tgt lat -75.056\n",
      "   tgt lon 0.704017\n",
      "   SUMup\n",
      "   2000-01-28\n",
      "   FDM\n",
      "   FDM index 16424\n",
      "   FDM distance from obs 3.459832023821101\n",
      "   FDM Lat -75.0443\n",
      "   FDM Lon 0.5928\n",
      "   SNOWPACK\n",
      "Working on site 96 of 124\n",
      "   tgt lat -75.01\n",
      "   tgt lon 0.08\n",
      "   SUMup\n",
      "   2017-01-23\n",
      "   FDM\n",
      "   FDM index 16423\n",
      "   FDM distance from obs 11.82375952622841\n",
      "   FDM Lat -75.0014\n",
      "   FDM Lon -0.3279\n",
      "   SNOWPACK\n",
      "Working on site 97 of 124\n",
      "   tgt lat -75.006\n",
      "   tgt lon 0.081867\n",
      "   SUMup\n",
      "   2000-01-03\n",
      "   FDM\n",
      "   FDM index 16423\n",
      "   FDM distance from obs 11.851338955748968\n",
      "   FDM Lat -75.0014\n",
      "   FDM Lon -0.3279\n",
      "   SNOWPACK\n",
      "Working on site 98 of 124\n",
      "   tgt lat -75.004783\n",
      "   tgt lon 0.079533\n",
      "   SUMup\n",
      "   2005-12-28\n",
      "   FDM\n",
      "   FDM index 16423\n",
      "   FDM distance from obs 11.779291452690796\n",
      "   FDM Lat -75.0014\n",
      "   FDM Lon -0.3279\n",
      "   SNOWPACK\n",
      "Working on site 99 of 124\n",
      "   tgt lat -75.002667\n",
      "   tgt lon 0.022667\n",
      "   SUMup\n",
      "   1997-12-29\n",
      "   FDM\n",
      "   FDM index 16423\n",
      "   FDM distance from obs 10.131720304157353\n",
      "   FDM Lat -75.0014\n",
      "   FDM Lon -0.3279\n",
      "   SNOWPACK\n",
      "Working on site 100 of 124\n",
      "   tgt lat -75.0025\n",
      "   tgt lon 0.007333\n",
      "   SUMup\n",
      "   1997-01-16\n",
      "   FDM\n",
      "   FDM index 16423\n",
      "   FDM distance from obs 9.688441134316308\n",
      "   FDM Lat -75.0014\n",
      "   FDM Lon -0.3279\n",
      "   SNOWPACK\n",
      "Working on site 101 of 124\n",
      "   tgt lat -75.002333\n",
      "   tgt lon 0.007\n",
      "   SUMup\n",
      "   1997-12-25\n",
      "   FDM\n",
      "   FDM index 16423\n",
      "   FDM distance from obs 9.67865290692884\n",
      "   FDM Lat -75.0014\n",
      "   FDM Lon -0.3279\n",
      "   SNOWPACK\n",
      "Working on site 102 of 124\n",
      "   tgt lat -75.0017\n",
      "   tgt lon 0.0678\n",
      "   SUMup\n",
      "      No obs!\n",
      "Working on site 103 of 124\n",
      "   tgt lat -75.000667\n",
      "   tgt lon -75.000667\n",
      "   SUMup\n",
      "   1998-01-21\n",
      "   FDM\n",
      "   FDM index 9007\n",
      "   FDM distance from obs 7.76237318383115\n",
      "   FDM Lat -74.9492\n",
      "   FDM Lon -75.181\n",
      "   SNOWPACK\n",
      "Working on site 104 of 124\n",
      "   tgt lat -75.000667\n",
      "   tgt lon -6.498333\n",
      "   SUMup\n",
      "   1998-01-21\n",
      "   FDM\n",
      "   FDM index 16207\n",
      "   FDM distance from obs 17.148059768364618\n",
      "   FDM Lat -75.1423\n",
      "   FDM Lon -6.2674\n",
      "   SNOWPACK\n",
      "Working on site 105 of 124\n",
      "   tgt lat -75.000667\n",
      "   tgt lon 8.005333\n",
      "   SUMup\n",
      "   1997-01-26\n",
      "   FDM\n",
      "   FDM index 16537\n",
      "   FDM distance from obs 3.8657729491493344\n",
      "   FDM Lat -74.9919\n",
      "   FDM Lon 8.1347\n",
      "   SNOWPACK\n",
      "Working on site 106 of 124\n",
      "   tgt lat -75.0\n",
      "   tgt lon -4.496333\n",
      "   SUMup\n",
      "   1998-01-19\n",
      "   FDM\n",
      "   FDM index 16314\n",
      "   FDM distance from obs 9.519227488988465\n",
      "   FDM Lat -75.033\n",
      "   FDM Lon -4.1923\n",
      "   SNOWPACK\n",
      "Working on site 107 of 124\n",
      "   tgt lat -74.997\n",
      "   tgt lon 0.036167\n",
      "   SUMup\n",
      "   1997-12-30\n",
      "   FDM\n",
      "   FDM index 16423\n",
      "   FDM distance from obs 10.53425256204006\n",
      "   FDM Lat -75.0014\n",
      "   FDM Lon -0.3279\n",
      "   SNOWPACK\n",
      "Working on site 108 of 124\n",
      "   tgt lat -74.96845\n",
      "   tgt lon 3.918167\n",
      "   SUMup\n",
      "   1998-01-13\n",
      "   FDM\n",
      "   FDM index 16532\n",
      "   FDM distance from obs 14.355536544681346\n",
      "   FDM Lat -74.9006\n",
      "   FDM Lon 3.498\n",
      "   SNOWPACK\n",
      "Working on site 109 of 124\n",
      "   tgt lat -74.949167\n",
      "   tgt lon -1.4945\n",
      "   SUMup\n",
      "   1998-01-17\n",
      "   FDM\n",
      "   FDM index 16422\n",
      "   FDM distance from obs 7.316791167361462\n",
      "   FDM Lat -74.9546\n",
      "   FDM Lon -1.243\n",
      "   SNOWPACK\n",
      "Working on site 110 of 124\n",
      "   tgt lat -74.855\n",
      "   tgt lon -2.55\n",
      "   SUMup\n",
      "   1997-01-13\n",
      "   FDM\n",
      "   FDM index 16421\n",
      "   FDM distance from obs 12.813252076301453\n",
      "   FDM Lat -74.904\n",
      "   FDM Lon -2.1522\n",
      "   SNOWPACK\n",
      "Working on site 111 of 124\n",
      "   tgt lat -74.854667\n",
      "   tgt lon -8.497\n",
      "   SUMup\n",
      "   1997-12-15\n",
      "   FDM\n",
      "   FDM index 16204\n",
      "   FDM distance from obs 14.597874210073888\n",
      "   FDM Lat -74.9154\n",
      "   FDM Lon -8.941\n",
      "   SNOWPACK\n",
      "Working on site 112 of 124\n",
      "   tgt lat -74.750667\n",
      "   tgt lon 0.999833\n",
      "   SUMup\n",
      "   1997-12-31\n",
      "   FDM\n",
      "   FDM index 16529\n",
      "   FDM distance from obs 8.927166060746517\n",
      "   FDM Lat -74.7978\n",
      "   FDM Lon 0.7539\n",
      "   SNOWPACK\n",
      "Working on site 113 of 124\n",
      "   tgt lat -74.667167\n",
      "   tgt lon 4.001667\n",
      "   SUMup\n",
      "   1998-01-04\n",
      "   FDM\n",
      "   FDM index 16635\n",
      "   FDM distance from obs 11.726915345334886\n",
      "   FDM Lat -74.6523\n",
      "   FDM Lon 3.6087\n",
      "   SNOWPACK\n",
      "Working on site 114 of 124\n",
      "   tgt lat -74.4995\n",
      "   tgt lon 1.961167\n",
      "   SUMup\n",
      "   1997-01-05\n",
      "   FDM\n",
      "   FDM index 16633\n",
      "   FDM distance from obs 10.991041471017514\n",
      "   FDM Lat -74.5888\n",
      "   FDM Lon 1.8055\n",
      "   SNOWPACK\n",
      "Working on site 115 of 124\n",
      "   tgt lat -74.499167\n",
      "   tgt lon 1.960833\n",
      "   SUMup\n",
      "   1998-01-02\n",
      "   FDM\n",
      "   FDM index 16633\n",
      "   FDM distance from obs 11.020604951487705\n",
      "   FDM Lat -74.5888\n",
      "   FDM Lon 1.8055\n",
      "   SNOWPACK\n",
      "Working on site 116 of 124\n",
      "   tgt lat -74.449\n",
      "   tgt lon -9.18067\n",
      "   SUMup\n",
      "   1998-12-29\n",
      "   FDM\n",
      "   FDM index 16413\n",
      "   FDM distance from obs 9.599336074974154\n",
      "   FDM Lat -74.3631\n",
      "   FDM Lon -9.1648\n",
      "   SNOWPACK\n",
      "Working on site 117 of 124\n",
      "   tgt lat -74.399\n",
      "   tgt lon 7.2175\n",
      "   SUMup\n",
      "   1997-01-24\n",
      "   FDM\n",
      "   FDM index 16741\n",
      "   FDM distance from obs 9.602673920970071\n",
      "   FDM Lat -74.4823\n",
      "   FDM Lon 7.2977\n",
      "   SNOWPACK\n",
      "Working on site 118 of 124\n",
      "   tgt lat -74.205\n",
      "   tgt lon -9.741667\n",
      "   SUMup\n",
      "   1997-12-11\n",
      "   FDM\n",
      "   FDM index 16412\n",
      "   FDM distance from obs 11.489461293254822\n",
      "   FDM Lat -74.2793\n",
      "   FDM Lon -10.0039\n",
      "   SNOWPACK\n",
      "Working on site 119 of 124\n",
      "   tgt lat -71.457222\n",
      "   tgt lon -9.860722\n",
      "   SUMup\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   2002-01-02\n",
      "   FDM\n",
      "   FDM index 17515\n",
      "   FDM distance from obs 10.780863701375129\n",
      "   FDM Lat -71.3673\n",
      "   FDM Lon -9.7499\n",
      "   SNOWPACK\n",
      "Working on site 120 of 124\n",
      "   tgt lat -71.214361\n",
      "   tgt lon -6.793861\n",
      "   SUMup\n",
      "   2002-01-02\n",
      "   FDM\n",
      "   FDM index 17691\n",
      "   FDM distance from obs 12.94040528567666\n",
      "   FDM Lat -71.2051\n",
      "   FDM Lon -6.4352\n",
      "   SNOWPACK\n",
      "Working on site 121 of 124\n",
      "   tgt lat -70.706667\n",
      "   tgt lon -8.426667\n",
      "   SUMup\n",
      "   1997-12-04\n",
      "   FDM\n",
      "   FDM index 17765\n",
      "   FDM distance from obs 7.101807813281313\n",
      "   FDM Lat -70.744\n",
      "   FDM Lon -8.2706\n",
      "   SNOWPACK\n",
      "Working on site 122 of 124\n",
      "   tgt lat -70.65861\n",
      "   tgt lon -8.2525\n",
      "   SUMup\n",
      "   1989-12-27\n",
      "   FDM\n",
      "   FDM index 17765\n",
      "   FDM distance from obs 9.55041028473329\n",
      "   FDM Lat -70.744\n",
      "   FDM Lon -8.2706\n",
      "   SNOWPACK\n",
      "Working on site 123 of 124\n",
      "   tgt lat -70.655692\n",
      "   tgt lon -8.253632\n",
      "   SUMup\n",
      "   2002-01-03\n",
      "   FDM\n",
      "   FDM index 17765\n",
      "   FDM distance from obs 9.872467031240385\n",
      "   FDM Lat -70.744\n",
      "   FDM Lon -8.2706\n",
      "   SNOWPACK\n",
      "Working on site 124 of 124\n",
      "   tgt lat -70.6\n",
      "   tgt lon -8.3\n",
      "   SUMup\n",
      "   1995-05-18\n",
      "   FDM\n",
      "   FDM index 17765\n",
      "   FDM distance from obs 16.102830765463562\n",
      "   FDM Lat -70.744\n",
      "   FDM Lon -8.2706\n",
      "   SNOWPACK\n"
     ]
    }
   ],
   "source": [
    "# Create .txt file for sumup dates\n",
    "f= open(\"/pl/active/nasa_smb/simulations/up_to_date_simulations/density_profile_10mfl_ov_rr/sumup_date.txt\",\"w\")\n",
    "\n",
    "# Create dictionary\n",
    "density_profile = {}\n",
    "\n",
    "# Loop through every geographic point\n",
    "for j in range(0, len(lat)):\n",
    "# for j in range(0, 10):\n",
    "    print(\"Working on site \" + str(j+1) + \" of \" + str(len(lat)))\n",
    "    # Retrieval filter parameters\n",
    "    tgt_lat = lat[j]\n",
    "    tgt_lon = lon[j]\n",
    "    high = 0 # Surface\n",
    "    low = 10 # 10 m depth\n",
    "    print(\"   tgt lat \" + str(tgt_lat))\n",
    "    print(\"   tgt lon \" + str(tgt_lon))\n",
    "    \n",
    "    # String names\n",
    "    sumup_depth_str = \"sumup_depth_\" + str(j + 1) \n",
    "    sumup_density_str = \"sumup_density_\" + str(j + 1)\n",
    "    sumup_error_str = \"sumup_error_\" + str(j + 1)\n",
    "    sumup_date_str = \"sumup_date_\" + str(j + 1)\n",
    "    fdm_depth_str = \"fdm_depth_\" + str(j + 1) \n",
    "    fdm_density_str = \"fdm_density_\" + str(j + 1)\n",
    "    snowpack_depth_str = \"snowpack_depth_\" + str(j + 1) \n",
    "    snowpack_density_str = \"snowpack_density_\" + str(j + 1)\n",
    "    \n",
    "    # SUMup\n",
    "    print(\"   SUMup\" )\n",
    "    obs_density, obs_depth, obs_date, obs_error, obs_method = \\\n",
    "        get_sumup(su_density, su_error, su_method, su_depth, su_date, su_lat, su_lon, tgt_lat, tgt_lon, high, low)\n",
    "    density_profile[sumup_depth_str] = obs_depth\n",
    "    density_profile[sumup_density_str] = obs_density\n",
    "    density_profile[sumup_date_str] = obs_date\n",
    "    density_profile[sumup_error_str] = obs_error\n",
    "\n",
    "    # If there are no observations, take no model data\n",
    "    if len(obs_density) == 0:\n",
    "        print(\"      No obs!\")\n",
    "        density_profile[fdm_depth_str] = []\n",
    "        density_profile[fdm_density_str] = []\n",
    "        density_profile[snowpack_depth_str] = []\n",
    "        density_profile[snowpack_density_str] = []\n",
    "#         f.write(\"NaN\\n\")\n",
    "    \n",
    "    # If there are observations, retrieve model data\n",
    "    else:\n",
    "        # Get observations timestamp\n",
    "        tmp_str = str(obs_date[0])\n",
    "        year = tmp_str[0:4]\n",
    "        month = tmp_str[4:6]\n",
    "        day = tmp_str[6:8]\n",
    "        if month == \"00\":\n",
    "            month = \"01\"\n",
    "        elif month == \"90\":\n",
    "            month = \"01\"\n",
    "        if day == \"00\":\n",
    "            day = \"01\"\n",
    "        timestamp = year + \"-\" + month + \"-\" + day + \" 12:00:00\"\n",
    "        timestamp_shell = year + \"-\" + month + \"-\" + day\n",
    "        tgt_date = pd.to_datetime(timestamp)\n",
    "        print(\"   \" + str(timestamp_shell))\n",
    "#         f.write(year + \"-\" + month + \"-\" + day + \"\\n\")\n",
    "        \n",
    "        # FDM\n",
    "        print(\"   FDM\" )\n",
    "        fdm_density, fdm_depth, fdm_date = get_FDM(tgt_lat, tgt_lon, tgt_date, high, low)\n",
    "        density_profile[fdm_depth_str] = fdm_depth\n",
    "        density_profile[fdm_density_str] = fdm_density\n",
    "\n",
    "        # SNOWPACK\n",
    "        print(\"   SNOWPACK\" )\n",
    "        snowpack_density, snowpack_depth = get_snowpack(tgt_lat, tgt_lon, timestamp_shell, high, low, j)\n",
    "        density_profile[snowpack_depth_str] = snowpack_depth\n",
    "        density_profile[snowpack_density_str] = snowpack_density  \n",
    "f.close()\n",
    "        "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Test postprocess.sh"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Save information into a pickle file"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Create a pickle file\n",
    "f = open(\"density_profile_10mfl_ov_rr.pkl\",\"wb\")\n",
    "pickle.dump(density_profile,f)\n",
    "f.close()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "a3d",
   "language": "python",
   "name": "a3d"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
